package com.glepoch.springbootsecuritymybatis.compoment.easyexcel;


import com.glepoch.springbootsecuritymybatis.compoment.easyexcel.entity.StudentEntity;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.List;

public class ImportDemo {
    public static void main(String[] args) throws FileNotFoundException {
        /*List<StudentEntity> studentEntities=new ArrayList<>();
        EasyExcel.read("D:/1.xls",StudentEntity.class, new ExcelListener(studentEntities,StudentEntity.class)).sheet().doRead();
        System.out.println(studentEntities);*/
        InputStream in=new FileInputStream("D:\\1.xls");
        //List<StudentEntity> studentEntities2 = new EasyExcelUtil<StudentEntity>().importData(in, StudentEntity.class);
        List<StudentEntity> paritiesEntitys = EasyExcelUtil.importData(in, StudentEntity.class);
        for (StudentEntity paritiesEntity : paritiesEntitys) {
            System.out.println(paritiesEntity);
            /*String name=paritiesEntity.getName();
            String id=paritiesEntity.getId();
            String nameId=paritiesEntity.getNameId();
            int orderBy=paritiesEntity.getOrderBy();
            String regDate=paritiesEntity.getRegDate();
            System.out.println("insert into PUB_DICT_ITEM(dict_id,dict_key,dict_value,dict_order,remark) values" +
                    "('"+id+"','"+orderBy+"','"+nameId+"',"+orderBy+",'"+name+"');");*/
        }

    }
}
